package com.itheima.googleplay9.ui.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.Window;

import com.itheima.googleplay9.R;
import com.itheima.googleplay9.adapter.ImageScaleAdapter;

import java.util.ArrayList;

/**
 * Created by lxj on 2016/5/27.
 */
public class ImageScaleActivity extends AppCompatActivity{
    ViewPager viewPager;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_image_scale);

        viewPager = (ViewPager) findViewById(R.id.viewPager);
        
        //1.获取图片的url集合数据
        ArrayList<String> urlList = getIntent().getStringArrayListExtra("urlList");
        int currentItem = getIntent().getIntExtra("currentItem", 0);

        ImageScaleAdapter adapter = new ImageScaleAdapter(urlList);
        viewPager.setAdapter(adapter);


        //设置默认选中的页
        viewPager.setCurrentItem(currentItem);
    }
}
